const path = require('path')

module.exports = {
  get proto () {
    return this.app.proto
  },

  get errors () {
    return {
      SUCCESS: {code: 0, message: `success.`},
      UNLOGINED: {code: 'unlogined', message: `you haven't logged in.`},
      WRONG_PWD: {code: 'wrong_password', message: `you supply one wrong password.`},
      PAYMENT_REQUIRED: {code: 'payment_required', message: `payment required.`},
      UPDATE_FAIL: {code: 'update_failure', message: `updating failure.`},
      INVALID_PARAMS: {code: 'wrong_params', message: `wrong parameters.`},
      NOT_FOUND: {code: 'not_found', message: `resources not found.`},
      NOT_SAME: {code: 'not_same', message: `resources not same.`},
    }
  },

  get validation () {
    return {
      password: {type: 'password', min: 6, max: 16},
      username: {type: 'username', min: 6, max: 16}
    }
  }
}
